package xiaochangsama.ancientkungfugeneration.procedures;

import xiaochangsama.ancientkungfugeneration.init.AncientKungfuGenerationModItems;

import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.network.chat.TextComponent;

public class QingGongText1Procedure {
	public static String execute(Entity entity) {
		if (entity == null)
			return "";
		if ((entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).getItem() == AncientKungfuGenerationModItems.JIANG_HU_QING_GONG_BOOK.get()) {
			return "\u00A7l\u6C5F\u6E56\u8F7B\u529F";
		} else {
			if (entity instanceof Player _player)
				_player.closeContainer();
			if (entity instanceof Player _player && !_player.level.isClientSide())
				_player.displayClientMessage(new TextComponent("\u00A7l\u00A74\u8BF7\u7528\u53F3\u624B\u9605\u8BFB"), (true));
		}
		return "\u00A7l\u00A74\u672A\u77E5";
	}
}
